package com.github.catvod.parser;

import com.github.catvod.crawler.SpiderDebug;
import com.github.catvod.spider.merge.CE;
import com.github.catvod.spider.merge.fP;
import java.util.HashMap;
import java.util.LinkedHashMap;
import org.json.JSONObject;

/* loaded from: classes.dex */
public class JsonSequence {
    public static JSONObject parse(LinkedHashMap<String, String> linkedHashMap, String str) {
        JSONObject BQ;
        try {
            if (linkedHashMap.size() > 0) {
                for (String str2 : linkedHashMap.keySet()) {
                    try {
                        HashMap<String, String> reqHeader = JsonBasic.getReqHeader(linkedHashMap.get(str2));
                        String str3 = reqHeader.get("url");
                        reqHeader.remove("url");
                        SpiderDebug.log(str3 + str);
                        BQ = CE.BQ(str, fP.oq(str3 + str, reqHeader));
                    } catch (Throwable th) {
                        SpiderDebug.log(th);
                    }
                    if (BQ != null) {
                        BQ.put("jxFrom", str2);
                        return BQ;
                    }
                }
            }
        } catch (Throwable th2) {
            SpiderDebug.log(th2);
        }
        return new JSONObject();
    }
}
